# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>

pkgname=python-aiostream
_name=${pkgname#python-}
pkgver=0.5.2
pkgrel=1
pkgdesc='Generator-based operators for asynchronous iteration'
arch=('any')
url=https://github.com/vxgmichel/aiostream
license=('GPL3')
depends=('python-typing_extensions')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=('python-pytest' 'python-pytest-asyncio')
source=("git+$url.git#tag=v$pkgver")
b2sums=('SKIP')

build() {
  cd "$_name"
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd "$_name"
  PYTHONPATH="$PWD/$_name:$PYTHONPATH" pytest tests --strict-markers -c /dev/null
}

package() {
  cd "$_name"
  python -m installer --destdir="$pkgdir" dist/*.whl
}
